﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.XtraReports.Web;
using DevExpress.Web.ASPxEditors;

public partial class Default3 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void ASPxDocumentViewer1_Load(object sender, EventArgs e)
    {

        this.ASPxDocumentViewer1.CustomizeParameterEditors += CustomizeParameterEditors;
    }

    void CustomizeParameterEditors(object sender, CustomizeParameterEditorsEventArgs e)
    {
        //ASPxSpinEdit editor = e.Editor as ASPxSpinEdit;

        //if (editor == null)
        //    return;
        //switch (e.Parameter.Name)
        //{
        //    case "Category":
        //        SetSpinEditParametrs(editor, 10248, 11077);
        //        break;
        //    case "MaxRowCountParameter":
        //        SetSpinEditParametrs(editor, 1, Int32.MaxValue);
        //        break;
        //}
        //e.Editor = editor;
        ASPxComboBox editor1 = e.Editor as ASPxComboBox;
        if (editor1 == null)
            return;
        switch (e.Parameter.Name)
        {
            case "Category1":
                SetSpinEditParametrs(editor1, "SPORTS");
                break;

        }
        e.Editor = editor1;
    }

    void SetSpinEditParametrs(ASPxComboBox editor, string value)
    {
        editor.Text = value;
        editor.Value = value;
    }

    void SetSpinEditParametrs(ASPxSpinEdit editor, int minValue, int maxValue)
    {
        editor.MinValue = minValue;
        editor.MaxValue = maxValue;
    }
}